<?php
                                                                                                                                                                                                                                                                                                                                        
// TTTTTTTTTTTTTTTTTTTTTTT                  MMMMMMMM               MMMMMMMM                                CCCCCCCCCCCCMMMMMMMM               MMMMMMMM  SSSSSSSSSSSSSSS 
// T:::::::::::::::::::::T                  M:::::::M             M:::::::M                             CCC::::::::::::M:::::::M             M:::::::MSS:::::::::::::::S
// T:::::::::::::::::::::T                  M::::::::M           M::::::::M                           CC:::::::::::::::M::::::::M           M::::::::S:::::SSSSSS::::::S
// T:::::TT:::::::TT:::::T                  M:::::::::M         M:::::::::M                          C:::::CCCCCCCC::::M:::::::::M         M:::::::::S:::::S     SSSSSSS
// TTTTTT  T:::::T  TTTTTppppp   ppppppppp  M::::::::::M       M::::::::::M   eeeeeeeeeeee          C:::::C       CCCCCM::::::::::M       M::::::::::S:::::S            
//         T:::::T       p::::ppp:::::::::p M:::::::::::M     M:::::::::::M ee::::::::::::ee       C:::::C             M:::::::::::M     M:::::::::::S:::::S            
//         T:::::T       p:::::::::::::::::pM:::::::M::::M   M::::M:::::::Me::::::eeeee:::::ee     C:::::C             M:::::::M::::M   M::::M:::::::MS::::SSSS         
//         T:::::T       pp::::::ppppp::::::M::::::M M::::M M::::M M::::::e::::::e     e:::::e     C:::::C             M::::::M M::::M M::::M M::::::M SS::::::SSSSS    
//         T:::::T        p:::::p     p:::::M::::::M  M::::M::::M  M::::::e:::::::eeeee::::::e     C:::::C             M::::::M  M::::M::::M  M::::::M   SSS::::::::SS  
//         T:::::T        p:::::p     p:::::M::::::M   M:::::::M   M::::::e:::::::::::::::::e      C:::::C             M::::::M   M:::::::M   M::::::M      SSSSSS::::S 
//         T:::::T        p:::::p     p:::::M::::::M    M:::::M    M::::::e::::::eeeeeeeeeee       C:::::C             M::::::M    M:::::M    M::::::M           S:::::S
//         T:::::T        p:::::p    p::::::M::::::M     MMMMM     M::::::e:::::::e                 C:::::C       CCCCCM::::::M     MMMMM     M::::::M           S:::::S
//       TT:::::::TT      p:::::ppppp:::::::M::::::M               M::::::e::::::::e                 C:::::CCCCCCCC::::M::::::M               M::::::SSSSSSS     S:::::S
//       T:::::::::T      p::::::::::::::::pM::::::M               M::::::Me::::::::eeeeeeee          CC:::::::::::::::M::::::M               M::::::S::::::SSSSSS:::::S
//       T:::::::::T      p::::::::::::::pp M::::::M               M::::::M ee:::::::::::::e            CCC::::::::::::M::::::M               M::::::S:::::::::::::::SS 
//       TTTTTTTTTTT      p::::::pppppppp   MMMMMMMM               MMMMMMMM   eeeeeeeeeeeeee               CCCCCCCCCCCCMMMMMMMM               MMMMMMMMSSSSSSSSSSSSSSS   
//                        p:::::p                                                                                                                                       
//                        p:::::p                                                                                                                                       
//                       p:::::::p                                                                                                                                      
//                       p:::::::p                                                                                                                                      
//                       p:::::::p                                                                                                                                      
//                       ppppppppp                                                                                                                                      
                                                                                                                                                                     
//  _____      __  __         ____ __  __ ____  
// |_   __ __ |  \/  | ___   / ___|  \/  / ___|     | AUTHOR: Xiaohe
//   | || '_ \| |\/| |/ _ \ | |   | |\/| \___ \     | EMAIL: 496631085@qq.com
//   | || |_) | |  | |  __/ | |___| |  | |___) |    | WECHAT: he4966
//   |_|| .__/|_|  |_|\___|  \____|_|  |_|____/     | DATETIME: 2021/07/27
//      |_|                                         | TpMeCMS 测试版本

namespace app\api\controller;
use app\api\controller\Tpmecms;
use think\Db;
use think\Config;
use fast\Random;
use fast\Http;
/**
 * 支付💰
 */
class Pay extends Tpmecms
{

    protected $noNeedLogin = ['*'];
    protected $noNeedRight = ['*'];
    public function _initialize()
    {
        parent::_initialize();
    }





    /**
     * @ApiInternal
     * 获取支付宝支付配置
     *
     * @return void
     */   
    public function get_alipay_params_self(){
        $params = new \Yurun\PaySDK\AlipayApp\Params\PublicParams;
        $config = Config::get('site');
        // $params->appID = '2021000118618361';
        $params->appID = $config['ali_app_id'];
        $params->apiDomain = $config['ali_apiDomain'];
        // $params->apiDomain = 'https://openapi.alipaydev.com/gateway.do'; // 设为沙箱环境，如正式环境请把这行注释
        // $params->format = 'JSON';
        $params->sign_type = 'RSA2';
        // $params->isUseAES = true;
        // // 使用公钥证书模式
        $params->usePublicKeyCert = true;

        // // 支付宝公钥证书文件路径
        $params->alipayCertPath = '/www/wwwroot/dll.wxnyxx.com/public/cert/alipayCertPublicKey_RSA2.crt';
        // 支付宝根证书文件路径
        $params->alipayRootCertPath = '/www/wwwroot/dll.wxnyxx.com/public/cert/alipayRootCert.crt';
        // 支付宝应用公钥证书文件路径
        $params->merchantCertPath = '/www/wwwroot/dll.wxnyxx.com/public/cert/appCertPublicKey_2021002181608598.crt';
        
        $params->aesKey   = '2deHluumqLLVvDmE/ptZCA==';
    //  halt(file_get_contents($params->alipayCertPath));
 
        //沙箱
        // $appPublicKey = 'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAgEJYRgGYyp+rVbqsUDcBM/HtPco5N01pzctign7MjrZmdRBHZASxIDbdEWa7SRM4S1SV+EyFV/vAW6BGgTnvqnJEP4dtfdjAVwg99LnAEskAT5zP+kreRVlakxcVFUPnKLNdyo47xkdiqEI/t5Cpn0PhE3py5r9Nbc2uMYUmg1f8r+2RlCvaN/fPZ3QJnRe92OwGRp7SLCybX5LftrYc1b7OiSGZs81y0WOPhiJTqtFc75zIGP9lEYAElqaR7yJhTZuAgGaUrRZnknM7y0my8ClDPiTu7f/d/JiV6VdE1kFADkIzlB9vAvL0FsI3IttpSRf6QHGZ19UqS3Sdet4RxQIDAQAB';
        // $appPublicKey = 'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAy0mnBgKLf053kfLSzZ5v3kcsg67lbELdrLc7V8KRYvdEqG6ZhQMVZFf4Dd97G8zgz/5hrxVDkA6ykS32v+5zL7YLSxOkV5FHZrQH3m5T2CGzP9RxIuxiUftUmCc9tO89aJ+fZCl39qQnxfZmeFuNOhR5pwWdNX2gT1pOUKYf021V0VcnO0/CZEvYIgwrtLafau8tjTKGD8CYM53LXl2/k4N0QuhXkZgy/ickgYlbHu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5PrZZheaCEq+WIPsGjyTdX9TBbm8uD39eJsF7B9wWVzp/2z9et43VlqqPaYpNueqlvB+dE0wyXIuA1jKlJ8zk';
 
        //应用公钥RSA2：实际
        // $appPublicKey = 'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAjlEOrideDlU3arqyPX3vUe2p5oM8etQEIdzhUIj8tztZ8d/JaUC2932xQBRRrFhbkdwxhxNkd79AEfHY1KS8SUXssrXWdTFI/snSOvrEE2l/eLRpC7jW2S1LrVKM3qW1UPQrtYAMgsZv0iHK2ahnk4tjTDKs9z5CF/0WMLZimVOs75hDpvR4IKpraWVGejbJQoVebYJPb3dL4GmY5r2APkhjJX2WP3mwDb12Zob+EHXhuDKmmcGtIh5CTtTxfsYjXUgXshMvQEJ7IipLbEHH+MJiXVANhJQ9Y5DGpfoMNJKh8qGjRVjiZAn5Yd/igz523/iXIz5vVnwhn3D2aa/uVQIDAQAB';
        
        //应用公钥RSA2
        $params->appPublicKey = 'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAlsxYl24wNXmEIwUmNpalU0WXooBE4BiTXiMrNiZeFDJQxLJ0E+tq0a9PLSxHtSoCEpopv/UWPUB9JpxV2ZRe/HexC8lW70NG9uNQURzVD/0NQMTCu8zTMygMxDyaJ1AS+HtoD/oSoiQ/kNDrvLRpUAmss+DYPWxZtuLx4kIDkIjZ8ZkrShTGFcGr7EhUkmsGIWUxdmtq4HG/Lp7noW1yMBUUWUUFMqfr0dKu4c+e1Eiz73dPPhyGOroD8ZZt1BfkU7kKv1qKP01luiqles7eByS29pMu9UTOdZi11QCloJp5S6BByYov+LDNn2YkAr/fXbfRwnOvqAgnmd3sn0FnsQIDAQAB';//$appPublicKey;
        //应用私钥2048.txt   支付宝开发工具生成
        $params->appPrivateKey = 'MIIEpAIBAAKCAQEAlsxYl24wNXmEIwUmNpalU0WXooBE4BiTXiMrNiZeFDJQxLJ0E+tq0a9PLSxHtSoCEpopv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AS+cet8nFo/2no/xmqL8COwK2sieCVFTtkHyOajUCT/J8CwmFT/HyOhFpqXBOW+zNTC8CkgwbpV7U3c4k+ksaq4QKBgQCF95wL6qivbTG/3Uw1I1U4kTXx4Ql6wvApsa4T59SOenDMsiOlTRJPARMKNImH1fr9MjlmL64IaVBgb6BFjDRSmZdfgWdLlX2ghZKlPlENez29FjiVilt3Df6NRfwpUEHOx9zi424pMcoKcq/CmFmxdXe0q9EiTJbrRTIfwd0aPQKBgQCCAP9mydZr0OxwAgvn8kHmyQBPcNDwUO7sgYaDplxEKFiYKAhgFDA6pyP8vbQKXWRnl3mm54U8yKMqBBOgjWgX9fJjx7r2j2sRuSbJy8xw1w6y/Uxo5wzH+qaxev/vGQ3wJTzcDf3w1i4I4BCDnTbut1MnEE/mV0WiYIuFkA/5Gg==';

        // $params->appPrivateKey = $appPrivateKey;//
        // 最早在线生成
        // $params->appPrivateKey = 'MIIEpAIBAAKCAQEAjlEOrideDlU3arqyPX3vUe2p5oM8etQEIdzhUIj8tztZ8d/JaUC2932xQBRRrFhbkdwxhxNkd79AEfHY1KS8SUXssrXWdTFI/snSOvrEE2l/eLRpC7jW2S1LrVKM3qW1UPQrtYAMgsZv0iHK2ahnk4tjTDKs9z5CF/0WMLZimVOs75hDpvR4IKpraWVGejbJQoVebYJPb3dL4GmY5r2APkhjJX2WP3mwDb12Zob+EHXhuDKmmcGtIh5CTtTxfsYjXUgXshMvQEJ7IipLbEHH+MJiXVANhJQ9Y5DGpfoMNJKh8qGjRVjiZAn5Yd/igz523/iXIz5vVnwhn3D2aa/uVQIDAQABAoIBAFuUFVpDwuZ+N5baZG/lZebWhIns0TJI1A/mTqbAP7641nwqgTTVi+deXnzZlmTMxr/pbYV6GSBlVRk3A0xyZSbRdCrbkBEBkfNCc6G4VAwZywklLqN4YeiGmTgC8tsizrY1KRs2NtbAUpxpWlsNXvk2rMMPqPXAfk9pcKoP8wquM5FIt+1L8KP9vK5VP3dXXFflYFFFZ4Ukp92hsl+9u0F5vlryvHOfqDiJWdRyUvyL1i5TSpC72kt/U0HXW7heDGz/ZXmYNNp8cEW66DyDWu53FeBWc+6HfpBWFbfixC+eVjAA7okwB0rDmB3DQ6Bi9fJwmQa8XtUhlfso5WvltgECgYEAyRx5FhUTScv0IwZvFzcCass/2oAe48WbI1aXMtTTTI5Hdne5aXSPnMbFlP8X7OSTSyHRRqTQnaWXLHj/zetGJiJ6UYij61yHjI7NvH0AcJy55FAr44PntwSIlLfMDWPOgrWCG33rzGPzQ90DLld2ODIZ/aMltP/FUUdZP2NC8rUCgYEAtSijuTNaPKIVMfM02CMJ5w3OdjdpiOIL3YsM/W6lMy6yz9o4GTtQFTfz6IHyxgCyCG4pR3Tj+okSRkUTGI3U5ZXWFm42xYMhaE9aoM8ujPx/WSvUwwsFdiC++Us/bdcjBwpIdB9VezzALTHAEUS6V3ZMSE6aNjCKgWZ/lnVyMSECgYEAis1MBSGmnlhVt5bJNYyR7oM5HuUubKYF3O32jO62py/Lwsf+//mi5OGLnLozGRzpTAGbHtbB5QxUui0I4GZxlABXy84y1E6YfzpQZLchhpek9R8gK3buhjJq0bnI67Tm4u/DTJYsGHUjgMMZXvKedUqfBZ+EdtfQp7hGsKkhm8ECgYBSY+9CVZaeqOCW3ROVkSn5yY+yuDTpKlVXJtx7jozXoE92tLp6zzz2yYHGpwMxBjPyHZfshb8BvMFw8A1lR2wiFmlNvkZuwdq5xA1lwZRcTqHkfki/hA2x0ebJHm30mLm3g/e7yFxqNhD4/P1rXSSajpTW9diw+Jalj2ZLmZKbwQKBgQDBB/5lp3JoG0lrX/Z0Fq8/A55aXBROl/HwiBda0GJBglXfrNSk/kshmfAd/l7OwHHOdOug7+UgzcauImMDCQL8PZ3juaDguOgjiaz09DcgGaGcss1ORFAusIbGbhsksHGUr4jwKodZZ3+kCXUlzWA9ZOYZV3Wf+MzjhqZ6KGrMCg==';
        
        // halt($params);
        return $params;      
    }

    // /**
    //  * 阿里支付订单💰
    //  *
    //  * @param array $data 订单信息
    //  * @return void
    //  */
    // public function ali_pay_order($data)
    // {
    //     $params = $this->get_alipay_params();
    //     // SDK实例化，传入公共配置
    //     $pay = new \Yurun\PaySDK\AlipayApp\SDK($params);
    //     // 支付接口
    //     $request = new \Yurun\PaySDK\AlipayApp\App\Params\Pay\Request;
    //     $request->notify_url = $this->request->domain().'/api/pay/alipay_query_pay_order';//$GLOBALS['PAY_CONFIG']['notify_url'];// 支付后通知地址（作为支付成功回调，这个可靠）
    //     $request->businessParams->out_trade_no = $data['order']; // 商户订单号
    //     $request->businessParams->total_amount = 0.01; // 价格
    //     $request->businessParams->subject = '捷拉拉-押金支付'; // 商品标题

    //     $request->businessParams->goods_type = "0";//商品主类型：0—虚拟类商品，1—实物类商品（默认）

    //     $request->businessParams->body = 'jiell'; // 商品标题
    //     $request->businessParams->time_expire = date('Y-m-d H:i:s',time()+600);

    //     $request->businessParams->timeout_express = "10m";
    //     $request->businessParams->return_params="123";
    //     // 处理
    //     $pay->prepareExecute($request, $url, $res);

    //     $this->success(http_build_query($res),http_build_query($res));
    //     echo $url; // 输出的是可以让app直接请求的url
    //     echo http_build_query($res); // 输出的是可以让app直接使用的参数
    // }





    public function ali_app_pay_money_order2($data)
    {
       


        // // 支付宝公钥证书文件路径
        // $alipayCertPath = './cert/alipayCertPublicKey_RSA2.crt';
        // // 支付宝根证书文件路径
        // $alipayRootCertPath = './cert/alipayRootCert.crt';
        // // 支付宝应用公钥证书文件路径
        // $merchantCertPath = './cert/appCertPublicKey_2021000118625372.crt';

        // 应用公钥：
        $appPublicKey = 'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAjlEOrideDlU3arqyPX3vUe2p5oM8etQEIdzhUIj8tztZ8d/JaUC2932xQBRRrFhbkdwxhxNkd79AEfHY1KS8SUXssrXWdTFI/snSOvrEE2l/eLRpC7jW2S1LrVKM3qW1UPQrtYAMgsZv0iHK2ahnk4tjTDKs9z5CF/0WMLZimVOs75hDpvR4IKpraWVGejbJQoVebYJPb3dL4GmY5r2APkhjJX2WP3mwDb12Zob+EHXhuDKmmcGtIh5CTtTxfsYjXUgXshMvQEJ7IipLbEHH+MJiXVANhJQ9Y5DGpfoMNJKh8qGjRVjiZAn5Yd/igz523/iXIz5vVnwhn3D2aa/uVQIDAQAB';
        // $appPublicKey = 'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAgEJYRgGYyp+rVbqsUDcBM/HtPco5N01pzctign7MjrZmdRBHZASxIDbdEWa7SRM4S1SV+EyFV/vAW6BGgTnvqnJEP4dtfdjAVwg99LnAEskAT5zP+kreRVlakxcVFUPnKLNdyo47xkdiqEI/t5Cpn0PhE3py5r9Nbc2uMYUmg1f8r+2RlCvaN/fPZ3QJnRe92OwGRp7SLCybX5LftrYc1b7OiSGZs81y0WOPhiJTqtFc75zIGP9lEYAElqaR7yJhTZuAgGaUrRZnknM7y0my8ClDPiTu7f/d/JiV6VdE1kFADkIzlB9vAvL0FsI3IttpSRf6QHGZ19UqS3Sdet4RxQIDAQAB';
        // $appPublicKey = 'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAy0mnBgKLf053kfLSzZ5v3kcsg67lbELdrLc7V8KRYvdEqG6ZhQMVZFf4Dd97G8zgz/5hrxVDkA6ykS32v+5zL7YLSxOkV5FHZrQH3m5T2CGzP9RxIuxiUftUmCc9tO89aJ+fZCl39qQnxfZmeFuNOhR5pwWdNX2gT1pOUKYf021V0VcnO0/CZEvYIgwrtLafau8tjTKGD8CYM53LXl2/k4N0QuhXkZgy/ickgYlbHu84Okl3x51CIC0GPIITqfk2dhJFhr7dbARD/cl92htbYri8AKOOhnWuc1kE9w2CrsQ8DIGEJUevWI500TKJUwBdFQB9FE7LvALuaXdx+GH3aQIDAQAB';
        // 应用私钥：
        // $appPrivateKey = 'MIIEpAIBAAKCAQEAjlEOrideDlU3arqyPX3vUe2p5oM8etQEIdzhUIj8tztZ8d/JaUC2932xQBRRrFhbkd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E3kFdUgTtWMbst4T26hgvmJj52+8f0QM3hWjC9KGFSqyOCDbfKl9h1lpXCPiSpAa3VD/4vpBqwNhniBsECgYEA/kFq9KDkUeUSvP5fPlkCxBNBqxzZaM2eWX8io4PZJTTraCyV/P8RfDmX2hymmAOBgsjF1FbbypEMN2/e+lzRnxV3q/PkL2VcL/I99l8S08XiMo6uttqdQmcMcUmaLBRRbXFp/gQnCSBwUP+WNWdmm3x0D7FmKnEM20ugiwPqXhECgYEAgSOfhWRYSVpIJRxOPRey6uua7bK30m4vuP3A5D69rBhlPO56AN7nOBMaWhfMKSy5wi9WthfnNqTlhPqPMOs/iSMioDuO/bTn3F7ZtTMRv7L8kRi94dQ6N2to39vHchbxJAJp3CzIzgT4aLqXRi8Zxis25lClzbabbu9ote4r1HUCgYEA6584PSf1Lye4q8iX/zGB7K9jxe1gVU1oF8xID3yaeW6HUe0vuluumo7M+OZgRLPLC6aAHv23hgvRZHaaDy6BXIoKcyH8LyghvJUjcvQ8gGD79Jphszb5UZYp47qv03Wo2GGoNi0m98BGFeomC6udXS6CaCCga2iE351AVFP2l+ECgYBvHwEgHiVeESKtVDr6lM7vGIc67CMDHq9P5oI5pMc/M8rBcI9o+mVJuh5d0cZq08KQFn3tuInLWn7pO1VFidglICemazlylF1DIhcBtY0bQF/WVszlauIhV/ppTkvDn3wmOTFwNNUheeNq8sxCpzrta7gU3OafKfd7sOSQT/5FFQKBgEiu2zx6e4NmiAfmhkm8d1yYCLHqtociNVaaIYW7IbbUJz79uefL1f9XYTVRD+FaGoZHV094Ioo+7L3RWtzmsYd5PrZZheaCEq+WIPsGjyTdX9TBbm8uD39eJsF7B9wWVzp/2z9et43VlqqPaYpNueqlvB+dE0wyXIuA1jKlJ8zk';
        

        $config = [
            'use_sandbox' => false, // 是否使用沙盒模式
            'app_id'    => Config::get('site.ali_app_id'),
            'sign_type' => 'RSA2', // RSA  RSA2
        
            // 支付宝公钥字符串
            'ali_public_key' => $appPublicKey,
        
            // 自己生成的密钥字符串
            'rsa_private_key' => $appPrivateKey,
        
            'limit_pay' => [
                // 'balance',// 余额
                // 'moneyFund',// 余额宝
                //'debitCardExpress',// 	借记卡快捷
                //'creditCard',//信用卡
                //'creditCardExpress',// 信用卡快捷
                //'creditCardCartoon',//信用卡卡通
                //'credit_group',// 信用支付类型（包含信用卡卡通、信用卡快捷、花呗、花呗分期）
            ], // 用户不可用指定渠道支付当有多个渠道时用“,”分隔
        
            // 与业务相关参数
            'notify_url' => $this->request->domain().'/api/pay/ali_pay_money_order_query',
            'return_url' => $this->request->domain(),
            'fee_type' => 'CNY', // 货币类型  当前仅支持该字段
        ];
        
        // 请求参数，完整参数见具体表格
        $payData = [
            'body'         => 'test2',
            'subject'      => 'test',
            'trade_no'     => time() . rand(1000, 9999),// 自己实现生成
            'time_expire'  => time() + 600, // 表示必须 600s 内付款
            'amount'       => '0.03', // 微信沙箱模式，需要金额固定为3.01
            'goods_type'    => '0',//商品主类型 :0-虚拟类商品,1-实物类商品
            'return_params' => '1234',
            'client_ip'    => isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : '127.0.0.1', // 客户地址
        ];
        
        // 使用
        try {
            $client = new \Payment\Client(\Payment\Client::ALIPAY, $config);
            
        
            $res    = $client->pay(\Payment\Client::ALI_CHANNEL_APP, $payData);
        } catch (InvalidArgumentException $e) {
            echo $e->getMessage();
            exit;
        } catch (\Payment\Exceptions\GatewayException $e) {
            echo $e->getMessage();
            var_dump($e->getRaw());
            exit;
        } catch (\Payment\Exceptions\ClassNotFoundException $e) {
            echo $e->getMessage();
            exit;
        } catch (Exception $e) {
            echo $e->getMessage();
            exit;
        }
   
        $this->success($res,$res);//explode('&',urldecode($res))
        exit();
    }


    /**
     * 🔐阿里充值钱包💰
     *
     * @param array $data 订单信息
     * @return void
     */
    public function ali_pay_money_order($data)
    {
        // $this->ali_app_pay_money_order2($data);
        $params = $this->get_alipay_params();

        // SDK实例化，传入公共配置
        $pay = new \Yurun\PaySDK\AlipayApp\SDK($params);
        // 支付接口
        $request = new \Yurun\PaySDK\AlipayApp\App\Params\Pay\Request;
        $request->notify_url = $this->request->domain();//$GLOBALS['PAY_CONFIG']['notify_url'];// 支付后通知地址（作为支付成功回调，这个可靠）
        $request->return_url = $this->request->domain();
        $request->businessParams->out_trade_no = time() . rand(1000, 9999); // 商户订单号
        $request->businessParams->total_amount = '0.02'; // 价格
        $request->businessParams->subject = 'jiell'; // 商品标题
        $request->businessParams->body = 'jiellbody'; // 商品标题
        // $request->businessParams->time_expire = date('Y-m-d H:i:s',time()+600);

        $request->businessParams->timeout_express = "10m";
        $request->businessParams->goods_type = "0";//商品主类型：0—虚拟类商品，1—实物类商品（默认）
        $request->businessParams->return_params="1232";
        // halt($request->businessParams);

        // halt($params);
        // halt($params->biz_content);
        // 处理
        // halt($request);
        $pay->prepareExecute($request, $url, $res);

        // $this->success($url,$res);
        // 'body'         => 'test2',
        //     'subject'      => 'test',
        //     'trade_no'     => $data['order'],// 自己实现生成
        //     'time_expire'  => time() + 600, // 表示必须 600s 内付款
        //     'amount'       => '0.01', // 微信沙箱模式，需要金额固定为3.01
        //     'goods_type'    => '0',//商品主类型 :0-虚拟类商品,1-实物类商品
        //     'return_params' => '123',
        //     'client_ip'
        $this->success($res,http_build_query($res));
        $this->success(http_build_query($res),$res);
        echo $url; // 输出的是可以让app直接请求的url
        echo http_build_query($res); // 输出的是可以让app直接使用的参数
    }




    public function query_ali_pay($order='Money2021100910044215')
    {
        // $this->query_ali_pay2($order);
        $params = $this->get_alipay_params();
        $pay = new \Yurun\PaySDK\AlipayApp\SDK($params);

        // 支付接口
        $request = new \Yurun\PaySDK\AlipayApp\Params\Query\Request();
        $request->notify_url = $this->request->domain().'/api/pay/ali_pay_money_order_query';// 支付后通知地址（作为支付成功回调，这个可靠）
        $request->return_url = $this->request->domain(); // 支付后跳转返回地址
        $request->businessParams->out_trade_no = $order; // 订单支付时传入的商户订单号,和支付宝交易号不能同时为空。
        // $request->businessParams->trade_no = ''; // 支付宝交易号，和商户订单号不能同时为空

        // 调用接口
        $result = $pay->execute($request);

        var_dump('result:', $result);
    }


    public function query_ali_pay2($order=null)
    {
        
        

     
        // $request->notify_url = $this->request->domain().'/api/pay/ali_pay_money_order_query?order='.$order;// 支付后通知地址（作为支付成功回调，这个可靠）
        // $request->return_url = $this->request->domain(); // 支付后跳转返回地址
        // $request->businessParams->out_trade_no = $order; // 订单支付时传入的商户订单号,和支付宝交易号不能同时为空。
        // $request->businessParams->trade_no = ''; // 支付宝交易号，和商户订单号不能同时为空

      
        $data = [
            'trade_no' => $order,
            //'transaction_id'     => '2020020222001440351000252549',
        ];
              // 应用公钥：
        $appPublicKey = 'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAjlEOrideDlU3arqyPX3vUe2p5oM8etQEIdzhUIj8tztZ8d/JaUC2932xQBRRrFhbkdwxhxNkd79AEfHY1KS8SUXssrXWdTFI/snSOvrEE2l/eLRpC7jW2S1LrVKM3qW1UPQrtYAMgsZv0iHK2ahnk4tjTDKs9z5CF/0WMLZimVOs75hDpvR4IKpraWVGejbJQoVebYJPb3dL4GmY5r2APkhjJX2WP3mwDb12Zob+EHXhuDKmmcGtIh5CTtTxfsYjXUgXshMvQEJ7IipLbEHH+MJiXVANhJQ9Y5DGpfoMNJKh8qGjRVjiZAn5Yd/igz523/iXIz5vVnwhn3D2aa/uVQIDAQAB';
        
        // 应用私钥：
        $appPrivateKey = 'MIIEpAIBAAKCAQEAjlEOrideDlU3arqyPX3vUe2p5oM8etQEIdzhUIj8tztZ8d/JaUC2932xQBRRrFhbkdwxhxNkd79AEfHY1KS8SUXssrXWdTFI/snSOvrEE2l/eLRpC7jW2S1LrVKM3qW1UPQrtYAMgsZv0iHK2ahnk4tjTDKs9z5CF/0WMLZimVOs75hDpvR4IKpraWVGejbJQoVebYJPb3dL4GmY5r2APkhjJX2WP3mwDb12Zob+EHXhuDKmmcGtIh5CTtTxfsYjXUgXshMvQEJ7IipLbE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ebJHm30mLm3g/e7yFxqNhD4/P1rXSSajpTW9diw+Jalj2ZLmZKbwQKBgQDBB/5lp3JoG0lrX/Z0Fq8/A55aXBROl/HwiBda0GJBglXfrNSk/kshmfAd/l7OwHHOdOug7+UgzcauImMDCQL8PZ3juaDguOgjiaz09DcgGaGcss1ORFAusIbGbhsksHGUr4jwKodZZ3+kCXUlzWA9ZOYZV3Wf+MzjhqZ6KGrMCg==';
       
 

        $config = [
            'use_sandbox' => false, // 是否使用沙盒模式
            'app_id'    => Config::get('site.ali_app_id'),
            'sign_type' => 'RSA2', // RSA  RSA2
        
            // 支付宝公钥字符串
            'ali_public_key' => $appPublicKey,
        
            // 自己生成的密钥字符串
            'rsa_private_key' => $appPrivateKey,
        
            'limit_pay' => [
                // 'balance',// 余额
                // 'moneyFund',// 余额宝
                //'debitCardExpress',// 	借记卡快捷
                //'creditCard',//信用卡
                //'creditCardExpress',// 信用卡快捷
                //'creditCardCartoon',//信用卡卡通
                //'credit_group',// 信用支付类型（包含信用卡卡通、信用卡快捷、花呗、花呗分期）
            ], // 用户不可用指定渠道支付当有多个渠道时用“,”分隔
        
            // 与业务相关参数
            'notify_url' => $this->request->domain().'/api/pay/ali_pay_money_order_query',
            'return_url' => $this->request->domain(),
        ];
        
        // 使用
        try {
            $client = new \Payment\Client(\Payment\Client::ALIPAY, $config);
            $res    = $client->tradeQuery($data);
        } catch (InvalidArgumentException $e) {
            echo $e->getMessage();
            exit;
        } catch (\Payment\Exceptions\GatewayException $e) {
            echo $e->getMessage();
            exit;
        } catch (\Payment\Exceptions\ClassNotFoundException $e) {
            echo $e->getMessage();
            exit;
        } catch (Exception $e) {
            echo $e->getMessage();
            exit;
        }





  
 
   
        $this->success($res,$res);//explode('&',urldecode($res))
        exit();
    }


    public function wap()
    {
        $params = $this->get_alipay_params();
        $pay = new \Yurun\PaySDK\AlipayApp\SDK($params);

        $order = 'test' . mt_rand(10000000, 99999999);
        $request = new \Yurun\PaySDK\AlipayApp\Wap\Params\Pay\Request();
        $request->notify_url = $this->request->domain().'/api/pay/ali_pay_money_order_query?order='.$order; // 支付后通知地址（作为支付成功回调，这个可靠）
        $request->return_url = $this->request->domain(); // 支付后跳转返回地址
        $request->businessParams->out_trade_no = $order; // 商户订单号
        $request->businessParams->total_amount = '0.03'; // 价格
        $request->businessParams->subject = '小米手机11'; // 商品标题

        // 跳转到支付页面
        // $pay->redirectExecute($request);

        // 获取跳转url
        $pay->prepareExecute($request, $url);
        // var_dump($url);
        echo '<a href="'.$url.'">'.$url.'</a>';
    }
}

